// JRtpSendVideo.h: interface for the CJRtpSendVideo class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_RTPAVSEND_H__7D33CD72_67C1_46B2_9651_B16C0216AA14__INCLUDED_)
#define AFX_RTPAVSEND_H__7D33CD72_67C1_46B2_9651_B16C0216AA14__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
typedef struct _RtpSession RtpSession;
typedef struct _RtpProfile RtpProfile;

static const GUID CLSID_JRtpSendVideo = 
{ 0xa1f1769b, 0x75a2, 0x4be9, { 0xb1, 0x28, 0x6c, 0xda, 0xd, 0xe3, 0x70, 0x4 } };


const AMOVIESETUP_FILTER sudJRtpSendVideo =
{
	&CLSID_JRtpSendVideo,		// clsID
	L"JRtpSendVideo",			// strName
	MERIT_DO_NOT_USE,			// dwMerit
	0,							// nPins
	0							// lpPin
};

class CJRtpSendVideo : public CBaseFilter
{
	friend class CVideoInputPin;
public: 
	DECLARE_IUNKNOWN;
	
	CJRtpSendVideo(LPUNKNOWN pUnk, HRESULT *phr);
    ~CJRtpSendVideo();
	
    static CUnknown * WINAPI CreateInstance(LPUNKNOWN lpunk, HRESULT *phr);

private:
	STDMETHODIMP NonDelegatingQueryInterface( REFIID riid, void** ppv );
	
private:
	CVideoInputPin*		m_pVideoInputPin;

	CBasePin*	GetPin(IN int Index);
	int			GetPinCount();


public:
	CVideoInputPin*  GetVideoInputPin();
    void setRtpSession(RtpSession *s,RtpProfile *profile, int payload);
	void sendSample(IMediaSample *pSample);
	//void CVideoInputPin::process_frame(mblk_t *inm);
public:
    CCritSec*	pStateLock(void) { return &m_cStateLock; }	// provide our critical section

	RtpSession *session;
   
	

protected:	
    int			m_iPins;		/* The number of pins on this filter. Updated by CSourceStream */
	CBasePin	**m_paStreams;	/* the pins on this filter. */
    CCritSec	m_cStateLock;	/* Lock this to serialize function accesses to the filter state */
	CCritSec        m_crtRecv ;         //  receiver lock;
};

#endif // !defined(AFX_RTPAVSEND_H__7D33CD72_67C1_46B2_9651_B16C0216AA14__INCLUDED_)
